MLRegress Components 1.0 for 32-Bit Delphi
© Copyright 1997 Applied Analytic Systems, Inc.
Decision Technologies Group

Purpose of Linear Regression

Many Delphi programmers are involved in the development of (database) systems for the gathering of experimental data.  The majority of experimental activities have goals of producing models or formulas by which a response y can be predicted given the values of one (or more) controllable variables x[1],...,x[n].    Regression is an approach which uses least-squares approximation to extract from experimental data, the nature of the cause and effect relationship between x and y.  Thus it assumes (1) that such a relationship exists, and (2) that the control variable(s) can be observed without error.

A (small) sample of systems which programmers might be involved in the development where regression analysis proves a useful methodology are:

•	[amount of precipitate] caused by a <solution's chemical reagent> and <temperature>
•	[job performance rating] based on scores of <test 1>, <test 2>, <test 3> and <test 4>
•	[sales] for a $ amount of <advertising>, <available staffing>, and [hours open]
•	[percentage of insect spoiled fruit] per <crop size> and <acreage>
•	[infant mortality rate] vs. <income>, <ethnic background>, <locality>

In the list above, the terms in the square brackets are the [response variables] to be predicted or classified, and those in the angular brackets are the <control variables> used to predict the value of [response].

Developers of data collection software provide significant added value to their clients or employers when their software makes serious attempts to provide explanations of the data relationships rather than simply storing and printing it.  The Multiple Regression Components allow users to explore many linear and non-linear relationships between various datafields in a dataset.

Role of the MLR Components

The Multiple Linear Regression components contain all of the mathematics required for modeling data from tables in which a relationship between the data in multiple datafields is suspected.  In addition to the mathematical formulas contained in the MLRQuery and MLRTable components, each of these components possess all of the functionality, methods, events, and properties of the Query (TQuery) and Table (TTable) components repectively.  

The MLR components are very flexible, allowing any of the control variables to  represent a transformation of the data contained in database table fields.  Possible transformations include products and quotients of two data fields, log of a datafield, inverse of a datafield, and values of any datafield raised to an integer power.  Response variables can also be transformed to achieve a curvi-linear regression model.  Modeling the data transformations is explained in the MLR Help file.  In addition, Applied Analytic Systems is developing a publication "Statistical Modeling with Delphi and C++ Builder", available in October 1997.

The MLRTable component requires all control variables and response variables to reside in the same database table.  Use the MLRQuery component with the appropriate SQL joins whenever the control and response variables are stored in multiple database tables.  Sample uses of both components are shown in the demo program.

Benefits:
ÞDelivering a self contained program which can instantaneously perform regression on any table(s) accessible by the TTable and/or TQuery through the Borland Database Engine.
ÞNo need to export data from Paradox, dBase, InterBase or other table formats into SPSS, SAS, Excel, Quattro Pro, or 1-2-3.
ÞScatter plots quickly show whether a linear data trend appears to be present among any of the control variables and the response variable.
ÞA variety of residual plots are available to access whether the general assumptions of a linear regression model are satisfied.
ÞPlots of residuals, y vs x, and cumulative distribution function can be viewed using the component methods, or via another third-party graphing utility using the component properties.
ÞThe Predict function can be used to indicate when a new data record appears to have problematic (outlying) data points (as soon as it is input by data entry personnel).
ÞDelphi direct linkable DCU file along with a two VCL Components, allows developers to set all the parameters visually if desired.
ÞSample project with multiple data tables and demo source code in Delphi 2.0 and 3.0.

Possible Concerns:
ÞBoth the developer and client may have insufficient understanding of the meaning of the regression outputs, consequently using it where it does not apply.  Users should always locate an Intermediate Statistical Methods text if in doubt.  The Applied Analytic Systems Statistical Consulting Group is available (at our normal rate) if specialized help is needed.

Evaluation Version Limitations:
The shareware evaluation version is fully functional within the Delphi IDE.  Applications which use the evaluation components cannot be distributed or run without Delphi.
 
There are two 32-Bit version of the MLR Components:
1. DCU Versions for Delphi 2.0 (Includes TMLRQuery and TMLRTable)
includes demo project and source code for the demo showing how to use the components.
2. DPK/DCU Package version for Delphi 3.0 (Includes TMLRQuery and TMLRTable)
includes demo project and source code for the demo showing how to use the components.
3. Full versions of each of the above are included when registered.  Source code is now available at a price of US $79.

NOTE: In addition to (or in lieu of) the source code for the component set, we can provide each user with detailed references on each of the mathematical routines used in the component.

Files to install (32-Bit)

The user can copy or unzip the files to any directory on the system.  The files named below are common to both 32-bit installations.  Note that there are separate file sets included for Delphi 2.0 and 3.0.  Only the names are the same.  In addition to the common installation files, the Delphi 3.0 version includes package files.

Installed Units (required in Delphi 2.0 and 3.0)		Usage

LoadGage.DCU	Data load progress unit
Matrix.DCU	Performs matrix calculations
Matrxdlg.DCU	Viewing correlation/covariance matrix	
Maxdata.DCU	Sets maximum data records allowed
Mlqabout.DCU	About the MLRQuery component
Mlr32reg.DCU	Register the component set into VCL
Mlrcode.DCU	Code for registered users
Mlrctrl.DCU	Control Variable Property Editor
Mlrforms.DCU	Misc. types and parameters
Mlroutpt.DCU	Output report for regression
Mlrplot.DCU	Plotting unit for scatter, residuals, ECDF
Mlrquery.DCU	MLRQuery component unit
Mlrresp.DCU	Response Variable Property Editor
Mlrtable.DCU	MLRTable component unit
Mlrtypes.DCU	MLR supporting classes
Mltabout.DCU	About the MLRTable component

Loadgage.DFM	Form file for data load progress
Matrxdlg.DFM	Form file for corr/covar matrix viewing
Mlqabout.DFM	Form file for About MLRQuery
Mlrctrl.DFM	Form file for Control Var property editor
Mlroutpt.DFM	Form file for Output report
Mlrresp.DFM	Form file for Response Var property ed.
Mltabout.DFM	Form file for About MLRTable

Mlr32reg.DCR`	MLR 32-bit component resource file

Installed Units (Delphi 3.0 Only)		Usage 

MlrDel30.DCP	Delphi 3.0 Component Package
MlrDel30.DPL	Delphi 3.0 Package Library
MlrDel30.DCU	Delphi 3.0 Package Compiled Unit
MlrDel30.DPK	Delphi 3.0 Package Source File
MlrDel30.RES	Delphi 3.0 Package Resource File

Installed Units (optional)		Usage 

Maxdata.PAS	Allows user to edit Maxdata constant	
Mlr32reg.PAS	Allows user to edit installation Page

Demo Units (optional)		Usage

Aptitude.DB	Paradox Sample data table
Bank.DB	Paradox Sample data table	
Bank.DBF	dBase Sample data table
Chemical.DBF	dBase Sample data table
Coffee.DB	Paradox Sample data table
Exmp12-2.DB	Paradox Sample data table
Invest.DB	Paradox Sample data table
Mlrdemo.DPR	Demo Project File
Mlrdemo1.DFM	Demo Form File
Mlrdemo.PAS	Demo Source Code 
Mlroptim.DCU	OptigressTM trial version	
Optgauge.DCU	OptigressTM progress gauge
Optgauge.DFM	OptigressTM progress gauge form file
Ovdc.DB	Paradox Sample data table
Ovdc.DBF	dBase Sample data table
Probdesc.DB	Descriptions of Sample Data
Probdesc.MB	Descriptions of Sample Data (memo)
Probdesc.PX	Descriptions of Sample Data (index)
Qpro14-7.DB	Paradox Sample data table	

Installation

Copy or unzip the files to the directory of choice for adding new VCL component.  It may make sense to keep the installation files together in their own directory; however, this is not necessary.
 
In Delphi 2.0

1) Select "Component"  and select "Install...".  
2) Add MLR32REG.DCU to the list of Installed Units.  
3) Click OK.  

The library will recompile and the Linear Regression component will be added to the "AAS Statistics" page on the Component Palette.  

It is also possible to install to a different page of choice by editing the Register procedure in MLR32REG.PAS, and adding it instead of MLR32REG.DCU.

In Delphi 3.0

1) Select "Component"  and select "Install Packages...".  
2) Click "Add...".  
3) "Look in" the directory containing the MLR installation files.   
4) Select MlrDel30.DPL and click Open.  
	Multiple Regression Components for Delphi 3.0  will be added to the list of Design Packages.  
5) Click OK.  

The Multiple Linear Regression components will be added to the "AAS Statistics" page on the Component Palette.  

It is also possible to install to a different page of choice by editing the Register procedure in MLR32REG.PAS, and compiling a new component package set.  This should be done INSTEAD of 1) - 5) above.  If the user is unfamiliar with this procedure, 1) - 5) should be used.  The user can change MLR component locations or palette page name by setting the Delphi 3.0 Environments Options.

The Demo Directory can be moved to any directory of choice.  Note that the Demo program looks for the database tables to be in the same directory as the Demo exe file.  Keep all demo files together in the same directory.

Run the Demo Program

The demo program helps to understand the usage of the components in a programmer's application.  Examine the Mlrdemo1.PAS source code.

Compile and run the Demo program.  Open the Regression Output Report by clicking the "Output" button.  Click "Plots" to view scatter and residual plots. An "Optimal" regression for the given control variables can be found by clicking "Optimize".  This demo also uses a TRIAL VERSION of Optigress(TM), available separately from Applied Analytic Systems, currently priced at US  $99.

IMPORTANT:  Please contact AAS if you experience any difficulty installing the component set and compiling/running the demo.  We will provide immediate support.

Function Reference
Both the MLRQuery and MLRTable components provide the same functions.

Data Input functions:
LoadValues
ReLoad

Regression functions:
Execute
Predict

Reporting and Graphing/Plotting functions:
Output
ShowPlots

For the exact descriptions and usage of each of these functions, please see the MLR help file.

Registration

License fees:

Both 16-bit and 32-bit Delphi DCUs (each containing MLRQuery and MLRTable VCL components):  

•		3 Independent Variables: US $79 for single-user, single-workstation.  
•		5 Independent Variables: US $99 for single-user, single-workstation.  
•		10 Independent Variables: US $149 for single-user, single-workstation.  

MLRegress license includes royalty-free runtime distribution.

No shipping charges within US or Canada.  US $5 for shipping outside of North America.

Pennsylvania-based developers must include an additional 7% sales tax on the total order.

Contact Applied Analytic Systems for site license discounts for multiple users at a single location.

The following payment methods are currently available:

Checks: Only checks drawn on a US bank valued in US$ can be accepted. Product will be shipped as soon as payment is received.  Mail Checks to:

Applied Analytic Systems, Inc.
Carnegie Office Park
Bldg 1, Suite 112
Carnegie,  PA  15106
USA

If the order is to be shipped to a Pennsylvania address, don't forget to include an additional 7% sales tax on the total order.

Credit Card Orders:  
 
Applied Analytic Systems has contracted NorthStar Solutions to process orders placed using Visa, MasterCard, or Discover card.  Please be sure to note the TMLRegress Product # when placing the order:

•		3 Independent Variables: US $79 for single-user, single-workstation - Product # [1891] 
•	5 Independent Variables: US $99 for single-user, single-workstation - Product # [1892]
•	10 Independent Variables: US $149 for single-user, single-workstation - Product # [1893]

INTERNET ORDERS
Order MLRegress Components through http://www.aasdt.com/statistics/mlr.html which links to the appropriate NorthStar online order form--fast, easy and secure!  Select the appropriate TMLRegress set from the product list.

PHONED ORDERS
Calls are taken 10 am - 8 pm, EST, Monday thru Saturday.

1-800-699-6395 (From the U.S. only.) 
1-803-699-6395 

FAXED ORDERS
Available 24 hours.
1-803-699-5465

Any questions about the status of the shipment of an order, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, non-credit card orders, ... should be directed to the Decision Technologies Group:

	CIS: 		70651,1370
	AOL:		aascorp
	Internet:		support@aasdt.com

	Web:		http://www.aasdt.com/

	Phone		412.278.2360
	FAX:		412.788.4205

Shipping:
Both e-mail and snail mail shipping is supported, so please provide your e-mail address if you have one!

Distribution:
This package can be redistributed if and only if it is a trial version and the original zip file is distributed intact.  Registered user's packages are not trial versions, and the licensees agree NOT to redistribute their component set in any way.  

If you would like to provide a trialware copy to a colleague, please contact Applied Analytic Systems for a distributable version, or link to http://www.aasdt.com/statistics/.